
function Add-PreStagingTables {
    param (
        [Parameter(Mandatory = $true)][LSInsightParameters]$LSInsight
    )

    # Locate the sql files.
    $folder = Join-Path $PSScriptRoot -ChildPath "..\Resources\Prestaging tables\All Companies\"
    $files = (Get-ChildItem -Path $folder -Filter "*.sql").FullName

    # Create tables.
    Write-Host # Newline.
    Write-Host "Creating the pre-staging tables in the LS Insight database..."
    $LSInsightLogin = @{
        ServerName = $LSInsight.Server.FullyQualifiedDomainName
        DatabaseName = $LSInsight.Database.Name
        Credential = $LSInsight.Server.Credential
    }
    Invoke-MultipleSQLScripts @LSInsightLogin -Files $files | Out-Null
}